# 1.导包
import pymysql
# 建立连接
conn =pymysql.connect(host='localhost',port=3306,user='root',password='root',charset='utf8',database='test01')
# 获取游标
cursor=conn.cursor()
name=input('请输入姓名')
sql='select * from student where stu_name="%s"'
sql1='select * from student where stu_name="" or 1=1 or "" '  #会查出所有的姓名
# cursor.execute(sql)
cursor.execute(sql1,[name])
res=cursor.fetchall()
print(res)

cursor.close()
conn.close()